package com.ruoyi.db.pms.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 商品评论对象 pms_comment
 *
 * @author ruoyi
 * @date 2020-04-20
 */

@ApiModel("商品评论实体类")
@Data
@EqualsAndHashCode(callSuper=true)
public class PmsComment extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("评论ID")
    private Long id;

    @ApiModelProperty("评论对象")
    @Excel(name = "评论对象")
    @NotBlank(message = "评论对象不能为空")
    private long valueId;

    @ApiModelProperty("评论类型（0是商品评论 1是专题评论）")
    @Excel(name = "评论类型", readConverterExp = "0=是商品评论,1=是专题评论")
    @NotBlank(message = "评论类型不能为空")
    private Integer type;

    @ApiModelProperty("评论内容")
    @Excel(name = "评论内容")
    @NotBlank(message = "评论内容不能为空")
    @Size(min = 0, max = 1023, message = "评论内容长度不能超过1023个字符")
    private String content;

    @ApiModelProperty("管理员回复内容")
    @Excel(name = "管理员回复内容")
    @NotBlank(message = "管理员回复内容不能为空")
    @Size(min = 0, max = 511, message = "管理员回复内容长度不能超过511个字符")
    private String adminContent;

    @ApiModelProperty("用户表的用户ID")
    @Excel(name = "用户表的用户ID")
    @NotBlank(message = "用户表的用户ID不能为空")
    private Long userId;

    @ApiModelProperty("是否含有图片")
    @Excel(name = "是否含有图片")
    private Boolean hasPicture;

    @ApiModelProperty("图片地址列表，采用JSON数组格式")
    @Excel(name = "图片地址列表，采用JSON数组格式")
    @Size(min = 0, max = 1023, message = "图片地址列表，采用JSON数组格式长度不能超过1023个字符")
    private String picUrls;

    @ApiModelProperty("评分， 1-5")
    @Excel(name = "评分， 1-5")
    private Integer star;

    // @author 严方亚
    @ApiModelProperty("创建时间")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime addTime;

    @ApiModelProperty("更新时间")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime updateTime;

    @ApiModelProperty("逻辑删除")
    @Excel(name = "逻辑删除")
    private Integer deleted;
}
